/**
 * Copyright 2012-2014 Naeregwen
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package components.tables.listeners;

import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import components.GamesLibrarian.WindowBuilderMask;
import components.Librarian;

/**
 * @author Naeregwen
 *
 */
public class GamesLibrarianTabChangeListener implements ChangeListener {

	Librarian librarian;
	JTabbedPane mainTabbedPane;
	
	public GamesLibrarianTabChangeListener(WindowBuilderMask me, JTabbedPane mainTabbedPane) {
		super();
		this.librarian = me != null ? me.getLibrarian() : null; // WindowBuilder
		this.mainTabbedPane = mainTabbedPane;
	}

	/* (non-Javadoc)
	 * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
	 */
	@Override
	public void stateChanged(ChangeEvent event) {
		// Check if selected Tab has onChange action
//        int selectedIndex = ((JTabbedPane) event.getSource()).getSelectedIndex();
//        int profileTabIndex = librarian.getTabComponentIndexByName(mainTabbedPane, "profileTab");
//        if (profileTabIndex == selectedIndex && librarian.getCurrentSteamProfile() == null && !librarian.isSteamProfileReading()) {
//        	librarian.readSteamProfile();
//        }
	}

}
